<?php
  session_start();
  include "config/fungsi_indotgl.php";  
  include "config/config78.inc";
  
  
  $link_get = "Blog-Gracemebel.com";
  $metadesc = "";
  if (isset($_GET["link"])) {
	  $link_get = $_GET["link"];
  } 
  $textJudul = str_replace('-', ' ', $link_get);
  if ($link_get == "Blog-Gracemebel.com") {
    $link_get = "";
  } else {
      $data_artikel = mysqli_query($MyCon,"SELECT * FROM artikel WHERE seo_nama_artikel  = '$link_get'");
      if ($data_artikel === true) {
          $rec019 = mysqli_fetch_array($data_artikel,MYSQLI_ASSOC); 
          $metadesc = !isset($rec019["meta_deskripsi"]) ? "" : $rec019["meta_deskripsi"];
      }

  }


?>

<!DOCTYPE html>

<base href="/" />

<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <!-- Mobile Web-app fullscreen -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="mobile-web-app-capable" content="yes">

    <!-- Meta tags -->
    <meta name="description" content="<?php echo $metadesc;?>">
    <meta name="author" content="">
    <link rel="shortcut icon" href="https://gracemebel.com/favicon.ico" type="image/x-icon"/>

    <!--Title-->



    <title><?php echo $textJudul;?></title>

    <!--CSS styles-->
    <link rel="stylesheet" media="all" href="mobel2020/css/bootstrap.css" />
    <link rel="stylesheet" media="all" href="mobel2020/css/animate.css" />
    <link rel="stylesheet" media="all" href="mobel2020/css/font-awesome.css" />
    <link rel="stylesheet" media="all" href="mobel2020/css/furniture-icons.css" />
    <link rel="stylesheet" media="all" href="mobel2020/css/linear-icons.css" />
    <link rel="stylesheet" media="all" href="mobel2020/css/magnific-popup.css" />
    <link rel="stylesheet" media="all" href="mobel2020/css/owl.carousel.css" />
    <link rel="stylesheet" media="all" href="mobel2020/css/ion-range-slider.css" />
    <link rel="stylesheet" media="all" href="mobel2020/css/theme.css" />
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css">

    <!--Google fonts-->
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,500,600&amp;subset=latin-ext" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <style>


.blog-post-text a:link {
  color: red;
  background-color: transparent;
  text-decoration: none;
}
.blog-post-text a:visited {
  color: red;
  background-color: transparent;
  text-decoration: none;
}
.blog-post-text a:hover {
  color: green;
  background-color: transparent;
  text-decoration: underline;
}
.blog-post-text a:active {
  color: yellow;
  background-color: transparent;
  text-decoration: underline;
}


    </style>

</head>

<body>

    <div class="page-loader"></div>

    <div class="wrapper">

        <!--Use class "navbar-fixed" or "navbar-default" -->
        <!--If you use "navbar-fixed" it will be sticky menu on scroll (only for large screens)-->

        <!-- ======================== Navigation ======================== -->
		<?php
		   include("headernew2020.php");
		?>
        <!-- ========================  Main header ======================== -->
		
		<?php 
		  if ($link_get == "") {
		?>
        <section class="main-header" style="background-image:url(mobel2020/assets/images/gallery-2.jpg)">
            <header>
                <div class="container">
                    <h1 class="h2 title">Blog</h1>
                    <ol class="breadcrumb breadcrumb-inverted">
                        <li><a href="#"><span class="icon icon-home"></span></a></li>
                        <li><a <?php if ($link_get == "") { echo " class='active' "; }?>href="blog">Blog Detail</a></li>
						<?php 
						  if ($link_get != "") {
						?>
                        <li><a class="active" href="blog-1.html">Modern design</a></li>
						<?php
						  }
						?>
                    </ol>
                </div>
            </header>
        </section>
		<?php
		  } else {
			  $artikel = mysqli_query($MyCon,"SELECT * FROM artikel WHERE seo_nama_artikel = '$link_get'");
			  $rec = mysqli_fetch_array($artikel,MYSQLI_ASSOC); 
		?>
        <section class="main-header main-header-blog" style="background-image:url(assets/images/gallery-1.jpg)">
            <header>
                <div class="container text-center">
                    <h2 class="h2 title">Blog</h2>
                    <ol class="breadcrumb breadcrumb-inverted">
                        <li><a href="/"><span class="icon icon-home"></span></a></li>
                        <li><a href="blog">Blog</a></li>
                        <li><a class="active" href="detailblog/<?php 
                        $skd = $rec["seo_nama_artikel"] ?? null;
                        if ($skd !== null) {
                            echo $rec["seo_nama_artikel"]; 
                        } else {
                            echo "";
                        }
                        ?>">
                        <?php 
                        $ldk = $rec["nama_artikel"] ?? null;
                        if ($ldk !== null) {
                            echo $ldk;
                        } else {
                            echo "";
                        }
                        ?></a></li>
                    </ol>
                </div>
            </header>
                      <center>
                       <!-- <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3847568528805063"
                                crossorigin="anonymous"></script>
                        <!-- Adsense_popilar_1143x90 -->
                           <!-- <ins class="adsbygoogle"
                                style="display:inline-block;width:1143px;height:90px"
                                data-ad-client="ca-pub-3847568528805063"
                                data-ad-slot="6529056859"></ins>
                            <script>
                                (adsbygoogle = window.adsbygoogle || []).push({});
                            </script> -->
                        </center>
        </section>
		
		<?php
		  }
		?>

        <!-- ========================  Blog ======================== -->
		
		<?php 
		  if ($link_get == "") {
		?>

          <!-- === header title === -->
                <center>
                <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3847568528805063"
                    crossorigin="anonymous"></script>
               <!-- Adsense_popilar_1143x90 -->
                <ins class="adsbygoogle"
                    style="display:inline-block;width:1143px;height:90px"
                    data-ad-client="ca-pub-3847568528805063"
                    data-ad-slot="6529056859"></ins>
                <script>
                    (adsbygoogle = window.adsbygoogle || []).push({});
                </script>
                </center>

		<section class="blog">

            <div class="container">


                <div class="row">

                    <!-- === blog-item === -->
					
					<?php
					  $artikel = mysqli_query($MyCon,"SELECT * FROM artikel ORDER BY tanggal DESC");
					  while ($row = mysqli_fetch_array($artikel,MYSQLI_ASSOC)) {
						  $gambar  = $row["gambar"];
						  $tanggal = strtotime($row["tanggal"]);
						  $bulan   = getBulan(date("m",$tanggal));
						  $tgl     = date("d",$tanggal);
						  $tahun   = date("Y",$tanggal);
						  $judul   = $row["nama_artikel"];
						  $seo_url = $row["seo_nama_artikel"];
						  $isi     = $row["deskripsi"];
					?>

                    <div class="col-sm-4">
                        <article>
                            <a href="detailblog/<?php echo $seo_url;?>">
                                <div class="image" style="background-image:url(<?php echo "upload/blog/".$gambar;?>)">
                                    <img src="<?php echo "upload/blog/".$gambar;?>" alt="<?php echo $judul;?>" />
                                </div>
                                <div class="entry entry-table">
                                    <div class="date-wrapper">
                                        <div class="date">
                                            <span><?php echo $bulan;?></span>
                                            <strong><?php echo $tgl;?></strong>
                                            <span><?php echo $tahun;?></span>
                                        </div>
                                    </div>
                                    <div class="title">
                                        <h2 class="h5"><?php echo $judul;?></h2>
                                    </div>
                                </div>
                            </a>
                        </article>
                    </div>
					<?php
					  }
					?>

                </div> <!--/row-->
                <!-- === pagination === 

                <div class="pagination-wrapper">
                    <ul class="pagination">
                        <li>
                            <a href="#" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                        <li class="active"><a href="#">1</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#">3</a></li>
                        <li><a href="#">4</a></li>
                        <li><a href="#">5</a></li>
                        <li>
                            <a href="#" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </ul>
                </div> /pagination-->

            </div><!--/container-->
        </section>
		<?php
		  } else {
			 
		?>
		
        <section class="blog">

            <!-- === blog navigation ===

            <div class="blog-navigation">

                <a class="nav-link prev" href="#">
                    <figure>
                        <div class="image">
                            <img src="mobel2020/assets/images/blog-2.jpg" alt="">
                        </div>
                        <figcaption>
                            <div class="blog-title h6">The 3 Tricks that Quickly Became Rules</div>
                        </figcaption>
                    </figure>
                </a>


                <a class="nav-link next" href="#">
                    <figure>
                        <div class="image">
                            <img src="mobel2020/assets/images/blog-3.jpg" alt="Alternate Text">
                        </div>
                        <figcaption>
                            <div class="blog-title h6">What does your favorite dining chair say about you?</div>
                        </figcaption>
                    </figure>
                </a>
            </div> /blog-navigation-->
            <!-- ========================  Blog post ======================== -->

            <div class="container">

                <div class="row">

                    <div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2">

                        <div class="blog-post">

                            <!-- === blog main image & entry info === -->
                            

                            <div class="blog-image-main">
                                <img src="
                                <?php 
                                    $gbr = $rec["gambar"] ?? null;
                                    if ($gbr !== null) {
                                        echo "upload/blog/".$rec["gambar"] . "alt= ".$textJudul;
                                    }
                                ?>
                                "/>
                            </div>

                            <div class="blog-post-content">

                                <!-- === blog post title === -->

                                <div class="blog-post-title">
                                    <h1 class="blog-title">
                                        <?php



                                        $kdj = $rec["nama_artikel"] ?? null;
                                        if ($kdj !== null) {
                                            echo $rec["nama_artikel"];
                                        }   
                                        ?>
                                    </h1>
                                    

                                    <div class="blog-info blog-info-top">
                                        <div class="entry">
                                            <i class="fa fa-user"></i>
                                            <span><?php echo "Grace";?></span>
                                        </div>
                                        <div class="entry">
                                            <i class="fa fa-calendar"></i>
                                            <span><?php
                                            $fld = $rec["tanggal"] ?? null;
                                            if ($fld !== null) {
                                                echo $rec["tanggal"];
                                            }  
                                            ?></span>
                                        </div>
                                        <div class="entry">
                                            <i class="fa fa-comments"></i>
                                            <span>0 comments</span>
                                        </div>
                                    </div> <!--/blog-info-->
                                </div>

                                <!-- === blog post text === -->

                                <div class="blog-post-text">
								
									<?php
                                     $ds = $rec["deskripsi"] ?? null;
                                     if ($ds !== null) {
                                         echo $rec["deskripsi"];
                                     }  
                                    ?>
									

                                </div>

                            </div>

                            <!-- === blog comments === -->

                            <div class="comments">

                  

                                <div class="comment-add">

                                    <div class="comment-reply-message">
									   <br>
                                        <div class="h3 title">Leave a Reply </div>
                                        <p>Your email address will not be published.</p>
                                    </div>

                                    <form action="#" method="post">
                                        <div class="form-group">
                                            <input type="text" class="form-control" name="name" value="" placeholder="Your Name" required="required"/>
                                        </div>
                                        <div class="form-group">
                                            <input type="text" class="form-control" name="name" value="" placeholder="Your Email" required="required"/>
                                        </div>
                                        <div class="form-group">
                                            <textarea rows="10" class="form-control" placeholder="Your comment" required="required"></textarea>
                                        </div>
                                        <div class="clearfix text-center">
                                            <input type="submit"  class="btn btn-main" value="Add comment" />
                                        </div>
                                    </form>

                                </div><!--/comment-add-->
                            </div> <!--/comments-->

                        </div><!--blog-post-->
                    </div><!--col-sm-8-->
                </div> <!--/row-->
            </div><!--/container-->
        </section>		
		<?php
		  }
		?>
        <!-- ================== Footer  ================== -->
		<?php
		   include("footernew2020.php");
		?>

    </div> <!--/wrapper-->
    <!--JS files-->
    <script src="mobel2020/js/jquery.min.js"></script>
    <script src="mobel2020/js/jquery.bootstrap.js"></script>
    <script src="mobel2020/js/jquery.magnific-popup.js"></script>
    <script src="mobel2020/js/jquery.owl.carousel.js"></script>
    <script src="mobel2020/js/jquery.ion.rangeSlider.js"></script>
    <script src="mobel2020/js/jquery.isotope.pkgd.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js"></script>
    <script src="mobel2020/js/grace.js"></script>
    <script src="mobel2020/js/main.js"></script>
</body>
</html>